<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/zc" prefix="zc"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="zcx"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${comments!}审核编辑</title>
        <zc:script src="jquery.js" />
        <zc:script src="jquery.base64.js" />
        <zc:script src="Public.js" />
        <zc:script src="CheckText.js" />
        <zc:iniCalendar />
        <zc:link href="style.css" />
        <script type="text/javascript">
            $(document).ready(function(){
                $("#btSave").click(function(){
                    $("#btSave").attr("disabled", true);
                    var varAction = "${r"${"}ctx}/${packageName!}/${className!}/save${className?cap_first!}.do";
                    $.ajax({
                        cache: true,
                        type: "post",
                        url:varAction,
                        data:$('#dataForm').serialize(),
                        async: true,
                        dataType: "json",
                        timeout:5000,
                        error: function(request) {
                            $("#btSave").attr("disabled", false);
                            alert("网络异常");
                        },
                        success: function(data) {
                            $("#btSave").attr("disabled", false);
                            alert(data.msg);
                            if(data.status == 1){
                                $("#id").val($("#${className!}id").val());
                            }
                        }
                    });
                });
            });
    
            function checkData(dataForm) {
                if (!checkFormItem(dataForm.xmmc, "C", 100, 0, 5, "投标项目名称")) return false;
                if (!checkFormItem(dataForm.tbsj, "C", 32, 0, 5, "投标日期"))return false;
                if (!checkFormItem(dataForm.cgfs, "C", 32, 0, 5, "采购方式"))return false;
    
                return true;
            }

            function ywspSubmit(){
                if(!checkData(dataForm)) return;
                if(!checkYwspData(dataForm)) return;
                var varAction = "${r"${"}ctx}/${packageName!}/${className!}/forward.do";
                dataForm.action = varAction;
                dataForm.target = "_self";
                dataForm.submit();
            }
        </script>
    </head>
    <body>
        <form id="dataForm" name="dataForm" method="post">
            <input type="hidden" id="id" name="id" value="${r"${"}${className!}.id}">
            <input type="hidden" id="${className!}id" name="${className!}id" value="${r"${"}${className!}id}">
            <div class="wcolumn line">
                <div class="column">
                    <span class="title bg1">${comments!}</span>
                </div>
            </div>
            <table class="table table-edit">
                <tr>
                    <td class="tright" style="width: 120px;">
                        <span class="hot">*</span>投标项目名称：
                    </td>
                    <td class="tleft">
                        <input type="text" class="form-control" id="xmmc" name="xmmc" value="${r"${"}${className!}.xmmc}" />
                    </td>
                </tr>
                <tr>
                    <td class="tright">
                        <span class="hot">*</span>投标日期：
                    </td>
                    <td class="tleft">
                        <zc:Calendar id="tbsj" name="tbsj" value="${r"${"}${className!}.tbsj}"/>
                    </td>
                </tr>
                <tr>
                    <td class="tright">
                        <span class="hot">*</span>采购方式：
                    </td>
                    <td class="tleft">
                        <zc:Radio name="cgfs" dmlb="CGFS" valueField="dmbs" textField="dmmc" value="${r"${"}${className!}.cgfs}"/>
                    </td>
                </tr>
                <tr>
                    <td class="tright">备注说明：</td>
                    <td class="tleft">
                        <textarea class="form-control" id="bzsm" name="bzsm" style="width: 500px;">${r"${"}${className!}.bzsm}</textarea>
                    </td>
                </tr>
            </table>

            <zcx:ywsp operates="{'shortcut':[{'id':'btSave','name':'btSave','type':'ywspsave','title':'保存信息'}]}" />
        </form>
    </body>
</html>
